import { defineStore } from 'pinia'
import getDetails from '../api/details'

export const useDetailsStore = defineStore('details', {
  state: () => ({
    data: {}
  }),
  actions: {
    async fetchGetDetails(id) {
      try {
        const res = await getDetails(id)
        // console.log(res)

        if (Object.keys(res).length > 0) {
          this.data = res.data
        }
      } catch (error) {
        console.error('获取详情数据失败：', error)
      }
    }
  }
})
 